<%--
    Document   : error
    Created on : Jun 6, 2014, 4:34:44 AM
    Author     : Yogesh Paisode
--%>
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>

<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>

<%

        String copyfirstName=(String)session.getAttribute("copyfirstName");
        String copylastName=(String)session.getAttribute("copylastName");
        String id=(String)session.getAttribute("id");
        String activationCode=(String)session.getAttribute("activationCode");
        String message="";

        if(copyfirstName==null){
                message="User ";

                session.setAttribute("message","MyInsurance");
                String  url[]=request.getRequestURI().split("/");
                String pageRedir=url[2];
                session.setAttribute("pageRedir",pageRedir);
                response.sendRedirect("login.jsp");

            }
        else{
                message=copyfirstName.substring(0,1).toUpperCase()+copyfirstName.substring(1);
                out.print("<title>"+copyfirstName.substring(0,1).toUpperCase()+copyfirstName.substring(1)+"-My Insurance</title>");
            }

%>
<jsp:include page="header.jsp"/>
<jsp:include page="startUpWith.jsp"/>
 <!-- CSS goes in the document HEAD or added to your external stylesheet -->
<style type="text/css">
table.gradienttable {
	font-family: verdana,arial,sans-serif;
	font-size:11px;
	color:#333333;
	border-width: 1px;
	border-color: #999999;
	border-collapse: collapse;
}
table.gradienttable th {
	padding: 0px;
	background: #d5e3e4;
	background: url();
	background: -moz-linear-gradient(top,  #d5e3e4 0%, #ccdee0 40%, #b3c8cc 100%);
	background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#d5e3e4), color-stop(40%,#ccdee0), color-stop(100%,#b3c8cc));
	background: -webkit-linear-gradient(top,  #d5e3e4 0%,#ccdee0 40%,#b3c8cc 100%);
	background: -o-linear-gradient(top,  #d5e3e4 0%,#ccdee0 40%,#b3c8cc 100%);
	background: -ms-linear-gradient(top,  #d5e3e4 0%,#ccdee0 40%,#b3c8cc 100%);
	background: linear-gradient(to bottom,  #d5e3e4 0%,#ccdee0 40%,#b3c8cc 100%);
	border: 1px solid #999999;
}
table.gradienttable td {
	padding: 0px;
	background: #ebecda;
	background: url();
	background: -moz-linear-gradient(top,  #ebecda 0%, #e0e0c6 40%, #ceceb7 100%);
	background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ebecda), color-stop(40%,#e0e0c6), color-stop(100%,#ceceb7));
	background: -webkit-linear-gradient(top,  #ebecda 0%,#e0e0c6 40%,#ceceb7 100%);
	background: -o-linear-gradient(top,  #ebecda 0%,#e0e0c6 40%,#ceceb7 100%);
	background: -ms-linear-gradient(top,  #ebecda 0%,#e0e0c6 40%,#ceceb7 100%);
	background: linear-gradient(to bottom,  #ebecda 0%,#e0e0c6 40%,#ceceb7 100%);
	border: 1px solid #999999;
}
table.gradienttable th p{
	margin:0px;
	padding:8px;
	border-top: 1px solid #eefafc;
	border-bottom:0px;
	border-left: 1px solid #eefafc;
	border-right:0px;
}
table.gradienttable td p{
	margin:0px;
	padding:8px;
	border-top: 1px solid #fcfdec;
	border-bottom:0px;
	border-left: 1px solid #fcfdec;;
	border-right:0px;
}
</style>

 <script type="text/javascript">
     // Popup window code
     function newPopup(url) {
         popupWindow = window.open(
		url, 'popUpWindow', 'height=600,width=800,left=10,top=10,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes')
     }
</script>


<%

       

        if(copyfirstName==null){
                message="User ";

            }
        else{
              message=copyfirstName.substring(0,1).toUpperCase()+copyfirstName.substring(1);
            }

        org.hibernate.SessionFactory sessionFactory=com.Auto.Common.InsuranceUpdate.Hibernate.InsuranceUpdate_HibernateUtil.getSessionFactory();
        org.hibernate.Session openSession=sessionFactory.openSession();
        org.hibernate.Transaction transaction=openSession.beginTransaction();

        org.hibernate.Query query=openSession.createQuery("from com.Auto.Common.InsuranceUpdate.Hibernate.Insuranceupdate where idFromUserInformation='"+id+"'");
        java.util.List l=query.list();



        String idFromUserInformation="";
        String postAd_Company_Name="";
        String postAd_Address="";
        String postAd_Location="";
        String postAd_Mobile_Number="";
        String postAd_Landline_Number="";
        String postAd_Image_Size="";
        String postAd_Templet_Image="";
        String postAd_Ad_Id="";
        String postAd_AmountToBePaid="";
        String postAd_Ad_Apprval="";





%>

<div style="position:relative;width: auto;z-index: 10000;">
    <div id="cssmenu" style="background-color: black;">
     <section class="innerpages">
         <div class="grid_12" style="background-image: url('commonfiles/images/satyapal.jpg'); width:100%;">
             <h1><%
             out.print(message+" Your Insurance State Is Here..");
            %> </h1>
         </div>
     </section>
</div>
</div>
<div class="block2">
  <div class="container_12">
    <!--==============================content================================-->
    <section class="content">
      <div class="wrapper">
        <article class="grid_12 last-col"><br><br><br>
          <div class="hello_box">


            

<a href="insuranceregi.jsp"><img src="https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcTosXA1Z-zpEjEASsNMYLPRjLn6vvTjMHjY7NuusaPS9xCR_Tgf2o9CYlQ"/></a>
<%
                int i=0;
                 String path[]={"AddressProof","AdharCard","DriverLicense","FirstCheck","IdProof","insurancePhotos","SalarySleep","SecondCheck","ThirdCheck"};
                 String picSet[]=new String[9];



                 if(l.isEmpty()){

                     out.print("<br>You Have Not Apply For Any Insurance <br><a href=\"insuranceregi.jsp\">Click Hear To Apply For Insurance</a>");
                 }else{




               for(Object o:l){

                        i=i+1;

                        com.Auto.Common.InsuranceUpdate.Hibernate.Insuranceupdate insuranceupdate=(com.Auto.Common.InsuranceUpdate.Hibernate.Insuranceupdate)o;
                       String insuranceCode=insuranceupdate.getInsuranceIdProof();
                        

                        String img="";
                        String button="",button2="";


                                    //img="";
                                    

                            String VehicleName=insuranceupdate.getInsuranceVehicleName();
                            String ManufacturingCompanyName=insuranceupdate.getInsuranceManufacturingCompanyName();
                            String VehicleChassisNumber=insuranceupdate.getInsuranceVehicleChassisNumber();
                            String VehicleRBookUniqueNumber=insuranceupdate.getInsuranceVehicleRcbook();
                            String VehicleType=insuranceupdate.getInsuranceVehicleType();
                           out.print("<table class=\"gradienttable\"><tr><th><p>Index</p></th><th><p>Insurance Code</p></th><th><p>Vehicle Name</p></th><th><p>Manufacturing Company Name</p></th><th><p>Vehicle Chassis Number</p></th><th><p>VehicleRC Book Unique Number</p></th><th><p>Vehicle Type</p></th></tr>");
                           out.print("<tr><td>"+i+"</td><td>"+insuranceCode+"</td><td>"+VehicleName+"</td><td>"+ManufacturingCompanyName+"</td><td>"+VehicleChassisNumber+"</td><td>"+VehicleRBookUniqueNumber+"</td><td>"+VehicleType+"</td></tr></table>");

                        java.io.BufferedReader br = null;

                       
		try {


                        for(int j=0;j<9;j++){

			String sCurrentLine="";

			br = new java.io.BufferedReader(new java.io.FileReader("VehicleHai/"+activationCode+"/Insurance/"+insuranceCode+"/"+path[j]+".vhi"));
                        postAd_Templet_Image="";
			while ((sCurrentLine = br.readLine()) != null) {
				//System.out.println(sCurrentLine);
                                postAd_Templet_Image=postAd_Templet_Image+sCurrentLine;
			}

                                picSet[j]=postAd_Templet_Image;

                        }

                        out.print("<table class=\"gradienttable\"><tr><th><p>Index</p></th><th><p>Insurance Code</p></th><th><p>Address Proof</p></th><th><p>Adhar Card</p></th><th><p>Driver License</p></th><th><p>First Check</p></th><th><p>Id Proof</p></th><th><p>Insurance Photos</p></th><th><p>Salary Sleep</p></th><th><p>Second Check</p></th><th><p>Third Check</p></th></tr>");
                        out.print("<tr><th><p>"+i+"</p></th><th><p>"+insuranceCode+"</p></th><th><p>"+"<a  href=\"JavaScript:newPopup('"+picSet[0]+"');\"><img src='"+picSet[0]+"' width=100 height=100/></a>"+"</p></th><th><p>"+"<a  href=\"JavaScript:newPopup('"+picSet[1]+"');\"><img src='"+picSet[1]+"' width=100 height=100/></a>"+"</p></th><th><p>"+"<a  href=\"JavaScript:newPopup('"+picSet[2]+"');\"><img src='"+picSet[2]+"' width=100 height=100/></a>"+"</p></th><th><p>"+"<a  href=\"JavaScript:newPopup('"+picSet[3]+"');\"><img src='"+picSet[3]+"' width=100 height=100/></a>"+"</p></th><th><p>"+"<a  href=\"JavaScript:newPopup('"+picSet[4]+"');\"><img src='"+picSet[4]+"' width=100 height=100/></a>"+"</p></th><th><p>"+"<a  href=\"JavaScript:newPopup('"+picSet[5]+"');\"><img src='"+picSet[5]+"' width=100 height=100/></a>"+"</p></th><th><p>"+"<a  href=\"JavaScript:newPopup('"+picSet[6]+"');\"><img src='"+picSet[6]+"' width=100 height=100/></a>"+"</p></th><th><p>"+"<a  href=\"JavaScript:newPopup('"+picSet[7]+"');\"><img src='"+picSet[7]+"' width=100 height=100/></a>"+"</p></th><th><p>"+"<a  href=\"JavaScript:newPopup('"+picSet[8]+"');\"><img src='"+picSet[8]+"' width=100 height=100/></a>"+"</p></th><th><p></tr></table><br>");
                        
		} catch (Exception e) {
			e.printStackTrace();
		}

                        
                 }


               }


              


%>



</table>






          </div>
        </article>
      </div>
      <div class="wrapper projects">
        <div class="row clearfix">


        </div>
      </div>
    </section>
  </div>
</div>


<jsp:include page="footer.jsp"/>
